how to read textfile in python

35

with open('the-zen-of-python.txt') as f:
    contents = f.read()
    print(contents)
Code language: JavaScript (javascript)

Comments

Submit
0 Comments